package cn.bupt.adt.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import cn.bupt.adt.dao.autogenerate.AttachedMapper;
import cn.bupt.adt.entity.autogenerate.Attached;
import cn.bupt.adt.entity.autogenerate.AttachedExample;
import cn.bupt.adt.service.IAttachedService;

@Service
public class AttachedServiceImpl implements IAttachedService{
	
	@Autowired
	AttachedMapper attachedMapper;
	
	@Override
	public List<Attached> getAllAttached(){
		return attachedMapper.selectByExample(new AttachedExample());
		
	}
	
	@Override
	public Boolean updateInfo(Attached attached){
		try {
			int i =  attachedMapper.updateByPrimaryKeySelective(attached);
			if(i<=0){
				return false;
			}
			else 
				return true;
			
		}catch (Exception e) {
			// TODO: handle exception
			return false;
		}
	}
}
